#!/bin/bash

VERSION=1.0

buildCommon() {
    cd fastdfs-common
    docker build --rm --tag=fastdfs-common:$VERSION .
    cd ..
}

buildTracker() {
    cd fastdfs-tracker
    docker build --rm --tag=fastdfs-tracker:$VERSION .
    cd ..
}

buildStorage() {
    cd fastdfs-storage
    docker build --rm --force-rm --tag=fastdfs-storage:$VERSION .
    cd ..
}

case "$1" in
  common)
  	buildCommon
	;;
  tracker)
  	buildTracker
	;;
  storage)
  	buildStorage
	;;
  *)
	buildCommon
    buildTracker
    buildStorage
    ;;
esac
